//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>

#include "ProcessCathPDBProfile.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main (int argc, char** argv) {
  
  String* filenameIn  = NULL;
  String* locationPDB = NULL;
  String* filenameOut = NULL;

  if (argc < 4) {
    
    cout << "Error in the input parameters! Must by like: " << endl;
    cout << "./CreateSeqFASTACompleteWithHeaders <File with Headers of FASTA Profile> <PDB Database Location> <Filename Out>" << endl;
    
    return 0;
    
  }
  else {
    
    filenameIn  = new String(argv[1]);
    locationPDB = new String(argv[2]);
    filenameOut = new String(argv[3]);
    
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << "  Profile FASTA Files : " << argv[1] << endl;
    cout << "PDB Database Location : " << argv[2] << endl;
    cout << "         Filename Out : " << argv[3] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    
  }
  
  ProcessCathPDBProfile* processCathPDBProfile = new ProcessCathPDBProfile ();
  
  cout << "Preparing Files..." << endl;
  processCathPDBProfile->LocationPDB(locationPDB);
  
  cout << "Writing the complete AA sequences for each domain..." << endl;
  processCathPDBProfile->CreateSeqFASTACompleteUsingHeaders(filenameIn, filenameOut);
  
  cout << "Finished..." << endl << "Good Bye" << endl;
  
  if (processCathPDBProfile) delete processCathPDBProfile;
  
  if (filenameIn)            delete filenameIn;
  if (locationPDB)           delete locationPDB;
  if (filenameOut)           delete filenameOut;

  return EXIT_SUCCESS;
  
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//

